package com.woniu.p2p.serviceImpl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.woniu.p2p.entity.UserMessage;
import com.woniu.p2p.mapper.UserMessageMapper;
import com.woniu.p2p.service.P2PMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 86152
 * @create 2020/8/10
 * @since 1.0.0
 */
@Service
public class P2PMessageServiceImp implements P2PMessageService {
    @Autowired
    UserMessageMapper userMessageMapper;
    /*获取分页数据*/
    @Override
    public PageInfo<UserMessage> findAll(int start, int size,int userid) {
        PageHelper.startPage(start,size);
        List<UserMessage> userMessages=userMessageMapper.findBYuserid(userid);
        PageInfo<UserMessage> userMessagePageInfo = new PageInfo<>(userMessages);
        return userMessagePageInfo;
    }
}
